package com.yunsc.product.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunsc.product.entity.YunscGoodsCategoryRelEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 商品与分类关系记录表
 * 
 * @author adan
 * @email 2028038953@qq.com
 * @date 2024-04-04 21:28:41
 */
@Mapper
public interface YunscGoodsCategoryRelDao extends BaseMapper<YunscGoodsCategoryRelEntity> {
    @Select("select goods_id from yunsc_goods_category_rel where category_id = #{categoryId}")
    List<Integer> queryGoodsIdByCategoryId(Integer categoryId);


    @Select("select category_id from yunsc_goods_category_rel where goods_id = #{goodsId}")
    List<Integer> queryCategoryIdsByGoodsId(Integer goodsId);


}
